#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
#include<assert.h>
void* my_memmove(void* dest,const void* src, size_t num)
{
	void* ret = dest;
	assert(dest && src);
	if (dest < src)
	{
		while (num--)
		{
			*((char*)dest) = *((char*)src);
			dest = (char*)dest + 1;
			src = (char*)src + 1;
		}

	}
	else
	{
		while (num--)
		{
			*((char*)dest + num) = *((char*)src + num);
		}
		return ret;
	}
		
}
int main()
{
	int arr1[] = { 1,2,3,4,5 };
	int arr2[20] = { 0 };
	my_memmove(arr1 + 2, arr1, 8);
	int i = 0;
	for (i = 0; i < 5; i++)
	{
		printf("%d ", *(arr1 + i));
	}
	printf("\n");
	char arr3[] = "hello world";
	memset((arr3 + 6), 'x', 5);
	puts(arr3);
	return 0;
}